import {Navigate, useRoutes} from 'react-router-dom'
import NotFound from '../404';
import Login from "../components/Login";
import Main from "../components/Main";
import About from "../components/Main/About";
import Home from "../components/Main/Home";
const routes = [
    {
        path : "/login",
        element : <Login/>
    },
    {
        path : "/main",
        element : <Main/>,
        children:[
            {
                path : "/main/about",
                element : <About/>
            },
            {
                path : "/main/home",
                element : <Home/>
            },
        ]
    },
    {
        path : "/",
        element : <Navigate to = '/login'/>
    },
    {
        path : "*",
        element : <NotFound/>
    },
]


export default routes;
export const GetRoutes = ()=>{
    return useRoutes(routes)
}

export const useMyRoutes = () =>{
    return useRoutes(routes)
}
